<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生信息表</title>
    <script>
        document.addEventListener('DOMContentLoaded', function() {  
            var students = new Array(); 
            var studentForm = document.getElementById('studentForm');  
            var studentTableBody = document.getElementById('studentTable').querySelector('tbody');  
  
            studentForm.addEventListener('submit', function(e) {  
                e.preventDefault();
                var name = document.getElementById('name').value;  
                var age = document.getElementById('age').value;  
                var email = document.getElementById('email').value;  
        
                var student = {  
                    name: name,  
                    age: parseInt(age),
                    email: email  
                };  
        
                students.push(student);  

                var row = document.createElement('tr');  
                row.innerHTML = `  
                    <td>${student.name}</td>  
                    <td>${student.age}</td>  
                    <td>${student.email}</td>  
                `;  
                studentTableBody.appendChild(row);  
 
                studentForm.reset();  
            });  
        });
    </script>  
    <style>
        #studentTable{
        width: 700px;
       }
       th{
        text-align: center;
        height: 30px;
       }
       td{
        text-align: center;
        height: 30px;
       }
    </style>
</head>  
<body>  
  
<form id="studentForm">  
    姓名： <input type="text" id="name" name="name" required>
    年龄：<input type="number" id="age" name="age" required>
    邮箱： <input type="email" id="email" name="email" required>
    <input type="submit" value="提交"> 
    <br><br>
</form>  
  
<table id="studentTable" border="1" cellspacing="0">  
    <thead>  
        <tr>  
            <th>姓名</th>  
            <th>年龄</th>  
            <th>邮箱</th>  
        </tr>  
    </thead>  
    <tbody></tbody>  
</table>  
</body>  
</html>